// 画分割线
@mixin divide-line($width: 100%, $height: 1px, $color: #0095d8, $opacity: 1) {
  width: $width;
  height: $height;
  background-color: $color;
  opacity: $opacity;
}

// 除第一项外的所有项与上一项的间距
@mixin item-gap($el, $direction: top, $margin: 10px) {
  .#{$el} + .#{$el} {
    margin-#{$direction}: $margin;
  }
}

// 实心三角形
@mixin triangle($direction, $size, $borderColor, $rotate) {
  content: "";
  height: 0;
  width: 0;
  transform: rotate($rotate);
  @if $direction == top {
    border-bottom: $size solid $borderColor;
    border-left: $size dashed transparent;
    border-right: $size dashed transparent;
  } @else if $direction == right {
    border-left: $size solid $borderColor;
    border-top: $size dashed transparent;
    border-bottom: $size dashed transparent;
  } @else if $direction == bottom {
    border-top: $size solid $borderColor;
    border-left: $size dashed transparent;
    border-right: $size dashed transparent;
  } @else if $direction == left {
    border-right: $size solid $borderColor;
    border-top: $size dashed transparent;
    border-bottom: $size dashed transparent;
  }
}

// 单行省略
@mixin font-overflow {
  overflow: hidden; /*超出部分隐藏*/
  text-overflow: ellipsis; /* 超出部分显示省略号 */
  white-space: nowrap; /*规定段落中的文本不进行换行 */
}

// 多行省略
@mixin line-overflow($n) {
  overflow: hidden;
  display: -webkit-box;
  text-overflow: ellipsis;
  -webkit-line-clamp: $n; /*要显示的行数*/
  -webkit-box-orient: vertical;
}

// 滚动
@mixin scroll($height, $type: "hidden") {
  overflow: auto;
  height: $height;
  @if $type == "hidden" {
    -ms-overflow-style: none;
    &::-webkit-scrollbar {
      display: none;
    }
  }
  @if $type == "bar" {
    @include bar;
  }
  @if $type == "hover" {
    &::-webkit-scrollbar {
      opacity: 0;
    }
    &:hover {
      @include bar;
    }
  }
}

@mixin bar {
  &::-webkit-scrollbar {
    opacity: 1 !important;
    width: 15px;
    background: rgba(13, 14, 60, 1);
  }
  &::-webkit-scrollbar-thumb {
    cursor: pointer;
    background: rgba(77, 78, 108, 1);
  }
}
